package com.example.introductiontoprogramming;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

public class Programming extends AppCompatActivity implements View.OnClickListener {

    private Button btnMainAb;
    private Button btnMainMax;
    private Button btnMainPsw;
    private Button btnMainWendu;
    private Button btnMainHanshu;
    private Button btnMainNum;
    private Button btnMainChengji;
    private Button btnMainLirun;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.programming_main);


        initView();

        btnMainAb.setOnClickListener(this);
        btnMainMax.setOnClickListener(this);
        btnMainPsw.setOnClickListener(this);
        btnMainWendu.setOnClickListener(this);
        btnMainHanshu.setOnClickListener(this);
        btnMainChengji.setOnClickListener(this);
        btnMainNum.setOnClickListener(this);
        btnMainLirun.setOnClickListener(this);
    }

    private void initView() {
        btnMainAb = (Button) findViewById(R.id.btn_main_ab);
        btnMainMax = (Button) findViewById(R.id.btn_main_max);
        btnMainPsw = (Button) findViewById(R.id.btn_main_psw);
        btnMainWendu = (Button) findViewById(R.id.btn_main_wendu);
        btnMainHanshu = (Button) findViewById(R.id.btn_main_hanshu);
        btnMainNum = (Button) findViewById(R.id.btn_main_num);
        btnMainChengji = (Button) findViewById(R.id.btn_main_chengji);
        btnMainLirun = (Button) findViewById(R.id.btn_main_lirun);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_main_ab:
                startActivity(new Intent(this, Programming1.class));
                break;
            case R.id.btn_main_max:
                startActivity(new Intent(this, Programming2.class));
                break;
            case R.id.btn_main_psw:
                startActivity(new Intent(this, Programming3.class));
                break;
            case R.id.btn_main_wendu:
                startActivity(new Intent(this, Programming4.class));
                break;
            case R.id.btn_main_hanshu:
                startActivity(new Intent(this, Programming5.class));
                break;
            case R.id.btn_main_chengji:
                startActivity(new Intent(this, Programming6.class));
                break;
            case R.id.btn_main_num:
                startActivity(new Intent(this, Programming7.class));
                break;
            case R.id.btn_main_lirun:
                startActivity(new Intent(this, Programming8.class));
                break;
        }


    }


}